﻿using System;
using System.Data.SqlClient;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SD.Entities;
using SD.DAL;
using SD.IDAL;
using SD.IBUS;


namespace SD.BUS
{
    public class OrgDetail2BIZ:BaseBIZ, IOrgDetail2BIZ
    {
        IOrgDetail2DAO orgDetail2DAO;

        public OrgDetail2BIZ()
        {
            orgDetail2DAO = new OrgDetail2DAO();
        }

        #region IOrgDetail2BIZ Members

        public List<string> GetByOrganization(string orgId)
        {
            try
            {
                return orgDetail2DAO.GetByOrganization(orgId);
            }
            catch (SqlException ex)
            {
                throw ex;
            }
        }
                
        public void Insert(string orgId, string refId)
        {
            try
            {
                orgDetail2DAO.Insert(orgId, refId);
            }
            catch (SqlException ex)
            {
                throw ex;
            }
        }

        public void Update(string orgId, List<ReferenceData> detail)
        {
            try
            {
                orgDetail2DAO.Update(orgId, detail);
            }
            catch (SqlException ex)
            {
                throw ex;
            }
        }

        public void Delete(string orgId, string refId)
        {
            try
            {
                orgDetail2DAO.Delete(orgId, refId);
            }
            catch (SqlException ex)
            {
                throw ex;
            }
        }

        #endregion
    }
}
